package org.aplikator.server.descriptor;

import org.aplikator.client.shared.descriptor.RadioButtonDTO;
import org.aplikator.client.shared.descriptor.WidgetDTO;
import org.aplikator.server.Context;

import java.io.Serializable;

public class RadioButton<T extends Serializable> extends WidgetPropertyDescriptorBase<T> {



    public RadioButton(Property<T> property) {
        super( property);
        if (property.getListProvider() == null) {
            throw new IllegalStateException("Property " + property.getId() + " must have assigned listProvider");
        }
    }

    @Override
    public WidgetDTO getWidgetDescriptor(Context ctx) {
        RadioButtonDTO desc = new RadioButtonDTO(getProperty().clientClone(ctx));
        desc.setSize(getSize());
        desc.setEnabled(isEnabled());
        return desc;
    }



}
